package org.lc.cmd.connect.impl;

import org.lc.cmd.connect.ClientRequest;
import org.lc.cmd.connect.ClientSession;
import org.lc.cmd.model.CmdRequestData;

import java.util.Map;

public interface BaseClientSession extends ClientSession {
    @Override
    default ClientRequest createRequest(String line) {
        CmdRequestData data = new CmdRequestData();
        data.setLine(line);
        data.setUseOriginCmd(true);
        return createRequest(data);
    }

    @Override
    default ClientRequest createRequest(String command, String subCommand, Map<String, String> args) {
        CmdRequestData data = new CmdRequestData();
        data.setCommand(command);
        data.setSubCommand(subCommand);
        data.setArgs(args);
        return createRequest(data);
    }

    ClientRequest createRequest(CmdRequestData data);
}
